package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;

import java.util.Map;

/**
 * @author shenb
 * @date 2022-06-29 14:27
 */
@TableName(value = "user_inf", autoResultMap = true)
public class User {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String name;
    private Integer age;

    @TableField(typeHandler = JacksonTypeHandler.class)
    private Map<String, String> struct;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Map<String, String> getStruct() {
        return struct;
    }

    public void setStruct(Map<String, String> struct) {
        this.struct = struct;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
